﻿@model shop.DanhMuc

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.ID)

        <div class="editor-label">
          Tên Danh Mục
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DanhMuc1)
            @Html.ValidationMessageFor(model => model.DanhMuc1)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MaDM)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MaDM)
            @Html.ValidationMessageFor(model => model.MaDM)
        </div>

        
        <div class="editor-field">
            @Html.HiddenFor(model => model.IDCha)
            @Html.ValidationMessageFor(model => model.IDCha)
        </div>

        <div class="editor-label">
           ID con
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IDCon)
            @Html.ValidationMessageFor(model => model.IDCon)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ViTri)
        </div>
        <div class="editor-field">
            <select name="ViTri">
                @if(Model.ViTri=="1")
                {
                  <option selected="selected" value="1">Vị trí 1</option>   
                       <option >Không Vị trí</option> 
                        <option  value="2">Vị trí 2</option> 
                        <option  value="3">Vị trí 3</option> 
                }
                else
                {
                  if(Model.ViTri=="2")
                  {
                     <option selected="selected" value="2">Vị trí 2</option>
                      <option >Không Vị trí</option> 
                        <option  value="1">Vị trí 1</option> 
                        
                        <option value="3">Vị trí 3</option>  
                  }
                  else
                  {
                     if(Model.ViTri=="3")
                     { 
                         <option value="3">Vị trí 3</option>
                    <option selected="selected">Không Vị trí</option> 
                        <option selected="selected" value="1">Vị trí 1</option> 
                        <option selected="selected" value="2">Vị trí 2</option> 
                        
                     }
                     else
                     {
                        <option selected="selected">Không Vị trí</option> 
                        <option  value="1">Vị trí 1</option> 
                        <option  value="2">Vị trí 2</option> 
                        <option  value="3">Vị trí 3</option>   
                     }
                  }
                }
            </select>
            @Html.ValidationMessageFor(model => model.ViTri)
        </div>

        <div class="editor-label">
           Cha
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Cha)
            @Html.ValidationMessageFor(model => model.Cha)
        </div>

        <p>
            <input type="submit" value="Lưu" />
        </p>
    
}
